/*
 * RouteWidget.h
 *
 *  Created on: Jan 13, 2011
 *      Author: Kevin Mueller
 */

#ifndef ROUTEWIDGET_H_
#define ROUTEWIDGET_H_

#include "SearchWidget.h"

#include <QComboBox>
#include <QDialog>

class LabeledCoordinate;
class SettingsComboBox;
class QPushButton;
class QCheckBox;

class RouteComboBox: public QComboBox {
Q_OBJECT

public:
	RouteComboBox(SearchWidget::Type t, int index = 0, RouteWidget* parent = 0);
	void setEntry(const LabeledCoordinate& coord);
//	LabeledCoordinate value() const;
//	bool validSelection() const;

private slots:
void indexChanged(int index);

private:
	SearchWidget::Type type;
	LabeledCoordinate coordinate;
};


class RouteWidget: public QDialog {
Q_OBJECT
public:
	RouteWidget(QWidget *parent = 0);
	void setModel(RouteSettings* model);
	void update();

signals:
	void startNavigation();

public slots:
	//	void searchOrigin();
	void setOrigin(const LabeledCoordinate& coord);
	//	void searchDestination();
	void setDestination(const LabeledCoordinate& coord);

private slots:
void calculate();
void noRoute();

private:
	void createComponents();
	void createLayout();

	RouteComboBox* origin;
	RouteComboBox* destination;
	SettingsComboBox *routecalc;
	QCheckBox *avoidHighways;
	QCheckBox *avoidTollroads;
	RouteSettings *model;
};

#endif /* ROUTEWIDGET_H_ */
